<template>
  <el-container>
    <el-header style="border-bottom: 1px solid #e6e6e6;"></el-header>
    <el-main class="none-padding">
      <el-table :data="dataList" stripe style="width: 100%" height="100%">
        <!-- <el-table-column prop="sourceId" label="sourceId" width="180" />
        <el-table-column prop="billTime" label="billTime" width="180" />
        <el-table-column prop="endTime" label="endTime" width="180" />
        <el-table-column prop="patientName" label="patientName" width="180" />
        <el-table-column prop="projectName" label="projectName" width="180" />
        <el-table-column prop="num" label="num" width="180" />
        <el-table-column prop="saleUnit" label="saleUnit" width="180" />
        <el-table-column prop="price" label="price" width="180" />
        <el-table-column prop="payment" label="payment" width="180" />
        <el-table-column prop="chargeTypeName" label="chargeTypeName" width="180" />
        <el-table-column prop="departmentName" label="departmentName" width="180" />
        <el-table-column prop="billPersonName" label="billPersonName" width="180" /> -->
        <el-table-column 
          v-for="(item, index) in colList"
          :key="index"
          :prop="item.sn" 
          :label="item.name" 
          ></el-table-column>
      </el-table>
    </el-main>
    <el-footer style="border-top: 1px solid #e6e6e6;"></el-footer>
  </el-container>
</template>

<script setup>
import { ref, onMounted } from 'vue'
import Service from '@/request/base'

const dataList = ref([])
const colList = ref([])

onMounted(() => {
  getList()
})

const getList = async() => {
  const {result} = await Service.get('http://localhost:8002/demo/test')
  dataList.value = result['content']
  colList.value = result['cols']
}

</script>

<style scoped>
</style>